<%-- 
    Document   : addEnrollevent
    Created on : Aug 25, 2014, 8:59:25 PM
    Author     : NGOCLINH-PC
--%>
<%@page import="Data.PayType"%>
<%@page import="Data.Event"%>
<%@page import="Data.Member"%>
<%@page import="Data.EnrollEvent"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<div class="tablemember">
    <form action="../EnrollEventPR" method="post" name="formmember">
        <h2 style="padding: 10px; color: #999;">Update EnrollEvent</h2>
                <hr />
        <table width="100%" border="0" align="center" cellpadding="14" cellspacing="14">

            <%
                if (request.getParameter("EenrolleventID") != null) {
                    EnrollEvent ct = new EnrollEvent();
                    int payID = Integer.parseInt(request.getParameter("EenrolleventID"));
                    ArrayList<EnrollEvent> a = ct.SselectByID(payID);
                    if (a.size() > 0) {
                        for (int i = 0; i < a.size(); i++) {
                            EnrollEvent pay = a.get(i);
                            out.print(" <input type='hidden' readonly name='txtEenrolleventID' id='txtEenrolleventID' value='" + pay.getEnrollEventID() + "' />");
            %>
            <tr>
                <td width='10%'>Event</td>
                <td width='50%'><label for='txtcateid'></label>
                    <%Event ev = new Event();
                        ArrayList<Event> lsEvent = ev.ESelectByID(pay.getEventID());
                        for (int e = 0; e < lsEvent.size(); e++) {
                            Event me = lsEvent.get(e);
                            out.print("<input type='text' readonly name='txtEvent' id='txtEvent' value='" + me.getEventName() + "' /></td>");
                        }%>
            </tr>
            
            <tr>
                <td width='10%'>Customer</td>
                <td width='50%'><label for='txtcateid'></label>
                    <%
                        Member m = new Member();
                        ArrayList<Member> mb = m.MselectById(pay.getMemberID());
                        for (int u = 0; u < mb.size(); u++) {
                            Member ma = mb.get(u);
                            //out.print("<td>" + ma.getUsername() + "</td>");

                            out.print("<input type='text' readonly name='txtMember' id='txtMember' value='" + ma.getUsername() + "' /></td>");
                        }%>
            </tr>

            <tr>
                <td width='10%'>Date Register</td>
                <td width='50%'><label for='txtcateid'></label>
                    <%  out.print("<input type='text' readonly name='txtMember' id='txtMember' value='" + pay.getDateReg() + "' /></td>");
                    %>
            </tr>
            <tr>
                <td width='10%'>Date Payment</td>
                <td width='50%'><label for='txtcateid'></label>
                    <%  out.print("<input type='date' name='txtDatePay' id='txtDatePay' value='' /></td>");
                    %>
            </tr>
            <tr>
                <td width='10%'>Payment Type</td>
                <td width='50%'><label for='txtcateid'></label>
                    <%PayType pt = new PayType();
                        ArrayList<PayType> lsPt = pt.PselectById(pay.getPayID());
                        for (int pa = 0; pa < lsPt.size(); pa++) {
                            PayType mp = lsPt.get(pa);
                            out.print("<input type='text' readonly name='txtMember' id='txtMember' value='" + mp.getPayName() + "' /></td>");
                        }%>
            </tr>
            <tr>
                <td width="10%">Is Payment</td>
                <td width="57%"><label for="txtIspayment"></label>
                    <select name="txtIspayment"   class="txtIspayment">
                        <% if (pay.getIspayment() == 1) {
                                out.print("<option value='1' selected='selected'>Yes</option>");
                                out.print("<option value='0'>No</option>");
                            } else {
                                out.print("<option value='1'>Yes</option>");
                                out.print("<option value='0' selected='selected'>No</option>");
                            }
                        %>
                    </select>
            </tr>

            <tr>
                <td>Status:</td>
                <%
                    if (pay.getStatus() == 1) {
                        out.print("<td><input type='radio' name='radio1' id='rdtrangthai' value='1' checked />");
                        out.print(" Show ");
                        out.print("<input type='radio' name='radio1' id='rdtrangthai' value='0' />");
                        out.print("Hidden</td>");
                    } else {
                        out.print("<td><input type='radio' name='radio1' id='rdtrangthai' value='1' />");
                        out.print(" Show ");
                        out.print("<input type='radio' name='radio1' id='rdtrangthai' value='0' checked />");
                        out.print("Hidden</td>");
                    }
                %>
            </tr>
            <tr>
                <td></td>
                <td colspan="2"><input type="submit" name="btnsubmit" id="btnsubmit" value="Submit" />
                </td>
            </tr>
            <%
                        }
                    }
                }
            %>



        </table>

    </form>
</div>
